** =============================================================================
** PUBLIC SECTOR HONESTY AND CORRUPTION: FIELD EVIDENCE FROM 40 COUNTRIES
** Journal of Public Administration Research and Theory
** Raanan Sulitzeanu-Kenan, Markus Tepe and Omer Yair
** August 2021
** =============================================================================

* Loading the dataset *
use "../civic_honesty_public.dta", clear


snapshot save

snapshot restore 1
*keep if inlist(cond,0,1, public_sector)
recode response(100=1)
gen priv_post_pub=institution
recode priv_post_pub(1=0)(2=0)(3=0)(4=1)(5=2)
label define three_lab 0 "Private sector" 1 "Postal" 2 "Public sector"
label values priv_post_pub three_lab
label var priv_post_pub "Categorical var. from the private, postal, and public sectors"
tab priv_post_pub institution

*** ==========================================
*** Experimental conditions items
*** ==========================================
gen money=1 if cond==1
recode money (.=0)
label var money "Dummy for the Money experimental condition"
gen big_money=1 if cond==2
recode big_money (.=0)
label var big_money "Dummy for the Big_Money experimental condition"
gen no_key=1 if cond==3
recode no_key (.=0)
label var no_key "Dummy for the No_Key experimental condition"
gen money2=1 if cond==1 | cond==2
recode money2 (.=0)
label var money2 "Dummy for the Money and Big_Money experimental conditions combined"


* ==========================================
* Public Sector Categories item
* ==========================================
gen public_cat_num=1 if public_category=="Local Administration"
replace public_cat_num=2 if public_category=="Governmental Department / Ministry"
replace public_cat_num=3 if public_category=="Public Safety and Law Enforcement"
replace public_cat_num=4 if public_category=="Other"
label var public_cat_num "Numeric Public Category item"
replace public_cat_num=0 if public_category==""
label define public_lab 0 "Private sector/Postal" 1 "Local Administration" 2 "Government" ///
						3 "Public Safety/Law" 4 "Other"
label values public_cat_num public_lab
tab public_cat_num 


* =======================
* Main analyses
* =======================

* Create sub-sector catetories
gen sub_cat=institution
replace sub_cat=6 if public_cat_num==2
replace sub_cat=7 if public_cat_num==3
replace sub_cat=8 if public_cat_num==4
label define sub_cat_names 1 "Bank" 2 "Cultural" 3 "Hotel" 4 "Post" 5 "Local administration" 6 "Government" 7 "Public safety & Law" 8 "Other public"
label values sub_cat sub_cat_names
label var sub_cat "All_sub-sectors"
tab sub_cat institution


* =======================
* Table 1
* =======================
* Compare return rates across eight institutional types:
tab response sub_cat, chi col
* Proportions of each private sub-sector within sector:
proportion sub_cat if sub_cat<4
* Proportions of each public sub-sector within sector:
proportion sub_cat if public==1
* Compare returen rates across public and private sectors:
tab response public if postal!=1, chi col


* =======================
* Table 2
* =======================
set more off
* Model 1 - country FE
reg response public postal busy i.country [pw=country], cluster(country) 
outreg2 using Table_2.doc, replace stats(coef se pval) dec(3) noaster  ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country [pw=country], cluster(country) 
outreg2 using Table_2.doc, append stats(coef se pval) dec(3) noaster  ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country [pw=country], cluster(country) 
outreg2 using Table_2.doc, append stats(coef se pval) dec(3) noaster  ///
 drop (i.country) addtext(Country Fixed-effects, "YES")
*reg response i.public postal busy i.cond i.country, cluster(country) 
*margins i.public, atmeans

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country [pw=country], cluster(country) 
outreg2 using Table_2.doc, append stats(coef se pval) dec(3) noaster   ///
drop (i.country) addtext(Country Fixed-effects, "YES")
margins i.cond##i.public, atmeans

* A Wald-Test of the significance of the 3 Public X experimental conditions interactions
gen pub_money=public*money
gen pub_bigmoney=public*big_money
gen pub_nokey=public*no_key
reg response public money big_money no_key pub_money pub_bigmoney pub_nokey ///
i.postal##i.cond busy i.country [pw=country], cluster(country) 
test pub_money + pub_bigmoney + pub_nokey==0
drop pub_money pub_bigmoney pub_nokey

** Comparing Busyness levels across institutions **
oneway busy priv_post_pub, t sch 
*oneway busy priv_post_pub if postal==0, t sch 

* ============================================================================
* ESTIMATING SOURCES OF VARIANCE - Section 4.3; and Table C2 in the appendix.
* ============================================================================
* Individual-level variance accounte for by country differences:
mixed response [pw=country] ||country:
estat icc
* Individual-level variance accounte for by country differences and sector-within-country differences:
mixed response if postal!=1 [pw=country]||country:|| public:
estat icc



* =======================
* Online Appendix
* =======================

** Table C1 - replication of Table 2 with logit regression **

* Model 1 - country FE
logit response public postal busy i.country [pw=country], cluster(country) 
outreg2 using Table_C1.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
logit response i.public_cat_num postal busy i.country [pw=country], cluster(country) 
outreg2 using Table_C1.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
logit response public postal busy i.cond i.country [pw=country], cluster(country) 
outreg2 using Table_C1.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
logit response i.public##i.cond i.postal##i.cond busy i.country [pw=country], cluster(country) 
outreg2 using Table_C1.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")


** Table C2 - with multi-level models **

* Model A - Individual-level variance accounte for by country differences:
mixed response [pw=country] ||country:
estat icc

* Model B - Individual-level variance accounte for by country differences and sector-within-country differences:
mixed response if postal!=1 [pw=country]||country:|| public:
estat icc

* Model 1 - country FE
mixed response public postal busy [pw=country], cluster(country) || country: 

* Model 2 - with public sector sub-categories
mixed response i.public_cat_num postal busy [pw=country], cluster(country) || country: 

* Model 3 - controlling for the experimental conditions
mixed response public postal busy i.cond [pw=country], cluster(country) || country: 

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
mixed response i.public##i.cond i.postal##i.cond busy [pw=country], cluster(country) || country: 



********************************************
** Adding year-adjusted Polity_4 data **
********************************************
gen Polity4_year_adj=.
recode Polity4_year_adj (.=9) if country==1 /* Argentina 2015 */
recode Polity4_year_adj (.=10) if country==2 /* Australia 2015 */
recode Polity4_year_adj (.=8) if country==3 /* Brazil 2015 */
recode Polity4_year_adj (.=10) if country==4 /* Canada 2015 */
recode Polity4_year_adj (.=10) if country==5 /* Chile 2016 */
recode Polity4_year_adj (.=-7) if country==6 /* China 2015 */
recode Polity4_year_adj (.=9) if country==7 /* Croatia 2014 */ 
recode Polity4_year_adj (.=9) if country==8 /* Czech Republic 2014 */
recode Polity4_year_adj (.=10) if country==9 /* Denmark 2014 */
recode Polity4_year_adj (.=9) if country==10 /* France 2014 */
recode Polity4_year_adj (.=10) if country==11 /* Germany 2014 */
recode Polity4_year_adj (.=8) if country==12 /* Ghana 2016 */
recode Polity4_year_adj (.=10) if country==13 /* Greece 2014 */
recode Polity4_year_adj (.=9) if country==14 /* India 2015 */
recode Polity4_year_adj (.=9) if country==15 /* Indonesia 2016 */
recode Polity4_year_adj (.=6) if country==16 /* Israel 2015 */
recode Polity4_year_adj (.=10) if country==17 /* Italy 2014 */
recode Polity4_year_adj (.=-6) if country==18 /* Kazakhstan 2016 */
recode Polity4_year_adj (.=9) if country==19 /* Kenya 2015 */
recode Polity4_year_adj (.=5) if country==20 /* Malaysia 2016 */
recode Polity4_year_adj (.=8) if country==21 /* Mexico 2015 */ 
recode Polity4_year_adj (.=-4) if country==22 /* Morocco 2015 */
recode Polity4_year_adj (.=10) if country==23 /* Netherlands 2014 */
recode Polity4_year_adj (.=10) if country==24 /* New Zealand 2015 */
recode Polity4_year_adj (.=10) if country==25 /* Norway 2015 */
recode Polity4_year_adj (.=9) if country==26 /* Peru 2016 */
recode Polity4_year_adj (.=10) if country==27 /* Poland 2013 */
recode Polity4_year_adj (.=10) if country==28 /* Portugal 2014 */
recode Polity4_year_adj (.=9) if country==29 /* Romania 2014 */
recode Polity4_year_adj (.=4) if country==30 /* Russia 2015 */
recode Polity4_year_adj (.=8) if country==31 /* Serbia 2014 */
recode Polity4_year_adj (.=9) if country==32 /* South Africa 2016 */
recode Polity4_year_adj (.=10) if country==33 /* Spain 2014 */
recode Polity4_year_adj (.=10) if country==34 /* Sweden 2014 */
recode Polity4_year_adj (.=10) if country==35 /* Switzerland 2014 */
recode Polity4_year_adj (.=-3) if country==36 /* Thailand 2015 */
recode Polity4_year_adj (.=3) if country==37 /* Turkey 2014 */
recode Polity4_year_adj (.=-8) if country==38 /* UAE 2015 */
recode Polity4_year_adj (.=10) if country==39 /* UK 2013 */
recode Polity4_year_adj (.=10) if country==40 /* USA 2015 */
label var Polity4_year_adj "The country's year-adjusted Polity 4 (democracy level) score"



** Table C3 - replication of Table 2, only democratic countries (Polity4>=6) **

set more off
* Model 1 - country FE
reg response public postal busy i.country if Polity4_year_adj>5 [pw=country], cluster(country) 
outreg2 using Table_C3.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country if Polity4_year_adj>5 [pw=country], cluster(country) 
outreg2 using Table_C3.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country if Polity4_year_adj>5 [pw=country], cluster(country) 
outreg2 using Table_C3.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country if Polity4_year_adj>5 [pw=country], cluster(country) 
outreg2 using Table_C3.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")


** Table C4 - replication of Table 2, only non-democratic countries (Polity4<6) **

set more off
* Model 1 - country FE
reg response public postal busy i.country if Polity4_year_adj<6 [pw=country], cluster(country) 
outreg2 using Table_C4.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country if Polity4_year_adj<6 [pw=country], cluster(country) 
outreg2 using Table_C4.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country if Polity4_year_adj<6 [pw=country], cluster(country) 
outreg2 using Table_C4.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country if Polity4_year_adj<6 [pw=country], cluster(country) 
outreg2 using Table_C4.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

drop Polity4_year_adj

*****************************************
** "Jackknifing" Table 2 - three times **
*****************************************

** Table C5 - without banks **
set more off
* Model 1 - country FE
reg response public postal busy i.country if institution!=1 [pw=country], cluster(country) 
outreg2 using Table_C5.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country if institution!=1 [pw=country], cluster(country) 
outreg2 using Table_C5.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country if institution!=1 [pw=country], cluster(country) 
outreg2 using Table_C5.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country if institution!=1 [pw=country], cluster(country) 
outreg2 using Table_C5.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")


** Table C6 - without culture institutions **
set more off
* Model 1 - country FE
reg response public postal busy i.country if institution!=2 [pw=country], cluster(country) 
outreg2 using Table_C6.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country if institution!=2 [pw=country], cluster(country) 
outreg2 using Table_C6.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country if institution!=2 [pw=country], cluster(country) 
outreg2 using Table_C6.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country if institution!=2 [pw=country], cluster(country) 
outreg2 using Table_C6.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")


** Table C7 - without hotels **
set more off
* Model 1 - country FE
reg response public postal busy i.country if institution!=3 [pw=country], cluster(country) 
outreg2 using Table_C7.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 2 - with public sector sub-categories
reg response i.public_cat_num postal busy i.country if institution!=3 [pw=country], cluster(country) 
outreg2 using Table_C7.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public postal busy i.cond i.country if institution!=3 [pw=country], cluster(country) 
outreg2 using Table_C7.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response i.public##i.cond i.postal##i.cond busy i.country if institution!=3 [pw=country], cluster(country) 
outreg2 using Table_C7.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")



*** Adjusting "public" to national share of banks controlled by the government: data from the World Bank ***
gen public_nbanks=public
recode public_nbanks (0=.4081) if country==1 & bank==1/* Argentina 2015 */
recode public_nbanks (0=.463) if country==3 & bank==1/* Brazil 2015 */
recode public_nbanks (0=.1643) if country==5 & bank==1 /* Chile 2016 */
recode public_nbanks (0=.) if country==6 & bank==1 /* China 2015: not included in the WB data */ 
recode public_nbanks (0=.052) if country==7 & bank==1 /* Croatia 2014 */ 
recode public_nbanks (0=.04) if country==8 & bank==1 /* Czech Republic 2014 */
recode public_nbanks (0=.06) if country==9 & bank==1 /* Denmark 2014 */
recode public_nbanks (0=.078) if country==10 & bank==1 /* France 2014 */
recode public_nbanks (0=.376) if country==11 & bank==1 /* Germany 2014 */
recode public_nbanks (0=.08) if country==12 & bank==1 /* Ghana 2016 */
recode public_nbanks (0=.686) if country==14 & bank==1 /* India 2015 */
recode public_nbanks (0=.396) if country==15 & bank==1 /* Indonesia 2016 */
recode public_nbanks (0=.2312) if country==18 & bank==1 /* Kazakhstan 2016 */
recode public_nbanks (0=.0439) if country==19 & bank==1 /* Kenya 2015 */
recode public_nbanks (0=.166) if country==21 & bank==1 /* Mexico 2015 */ 
recode public_nbanks (0=.17) if country==22 & bank==1 /* Morocco 2015 */
recode public_nbanks (0=.28) if country==23 & bank==1 /* Netherlands 2014 */
recode public_nbanks (0=.04) if country==24 & bank==1 /* New Zealand 2015 */
recode public_nbanks (0=.055) if country==26 & bank==1 /* Peru 2016 */
recode public_nbanks (0=.223) if country==27 & bank==1 /* Poland 2013 */
recode public_nbanks (0=.41) if country==28 & bank==1 /* Portugal 2014 */
recode public_nbanks (0=.087) if country==29 & bank==1 /* Romania 2014 */
recode public_nbanks (0=.586) if country==30 & bank==1 /* Russia 2015 */
recode public_nbanks (0=.192) if country==31 & bank==1 /* Serbia 2014 */
recode public_nbanks (0=.03) if country==33 & bank==1 /* Spain 2014 */
recode public_nbanks (0=.0237) if country==34 & bank==1 /* Sweden 2014 */
recode public_nbanks (0=.211) if country==35 & bank==1 /* Switzerland 2014 */
recode public_nbanks (0=.16) if country==36 & bank==1 /* Thailand 2015 */
recode public_nbanks (0=.313) if country==37 & bank==1 /* Turkey 2014 */
recode public_nbanks (0=.45) if country==38 & bank==1 /* UAE 2015 */
recode public_nbanks (0=.11) if country==39 & bank==1 /* UK 2013 */
label var public_nbanks "public including public banks"


** Table C8 - Replacing the Public Sector dummy with the share of Goverment-controlled anks **
set more off
* Model 1
reg response public_nbanks postal busy i.country [pw=country], cluster(country)
outreg2 using Table_C8.doc, replace stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "NO")

* Model 2 - country FE
reg response i.public_cat_num postal busy i.country [pw=country], cluster(country)
outreg2 using Table_C8.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 3 - controlling for the experimental conditions
reg response public_nbanks postal busy i.cond i.country [pw=country], cluster(country)
outreg2 using Table_C8.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

* Model 4 - with MoneyXpublic and MoneyXPostal interactions
reg response c.public_nbanks##i.cond i.postal##i.cond busy i.country [pw=country], cluster(country)
outreg2 using Table_C8.doc, append stats(coef se pval) dec(3) noaster ///
drop (i.country) addtext(Country Fixed-effects, "YES")

drop public_nbanks